package com.qys.livesMall.app.user.model.dto.sys;

import com.qys.livesMall.framework.view.BaseQuery;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;


@Data
public class WithdrawalsStatisticsPage extends BaseQuery {

    @Schema(description = "用户UID")
    private String userRandomId;

    @Schema(description = "提单开始时间")
    private LocalDateTime createTimeStart;

    @Schema(description = "提单结束时间")
    private LocalDateTime createTimeEnd;

    @Schema(description = "审核开始时间")
    private LocalDateTime auditTimeStart;

    @Schema(description = "审核结束时间")
    private LocalDateTime auditTimeEnd;

    @Schema(description = "用户名称")
    private String userName;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "审核状态")
    private String auditStatus;

    @Schema(description = "金额下限")
    private BigDecimal lowerAmount;

    @Schema(description = "金额上限")
    private BigDecimal upperAmount;

    @Schema(description = "用户直推")
    private String userDirectPush;

    @Schema(description = "用户三代")
    private String user3rdGeneration;

    @Schema(description = "用户伞下")
    private String userUnderUmbrella;

    @Schema(hidden = true)
    private List<String> userList;

    private List<Long> userIds;

    @Schema(description = "提现次数")
    private Integer withdrawalsNum;

    @Schema(description = "提现地址")
    private String withdrawalsAddress;

    @Schema(description = "提现方式(0银行卡,1usdt,2BIT)")
    private Byte paymentMethod;

    @Schema(description = "层级")
    private Integer storey;

    public void setCreateTimeStart(Long createTimeStart) {
        if (null == createTimeStart){
            return;
        }
        LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(createTimeStart), ZoneId.systemDefault());
        this.createTimeStart = localDateTime;
    }

    public void setCreateTimeEnd(Long createTimeEnd) {
        if (null == createTimeStart){
            return;
        }
        LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(createTimeEnd), ZoneId.systemDefault());
        this.createTimeEnd = localDateTime;
    }

    public void setAuditTimeStart(Long auditTimeStart) {
        if (null == createTimeStart){
            return;
        }
        LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(auditTimeStart), ZoneId.systemDefault());
        this.auditTimeStart = localDateTime;
    }

    public void setAuditTimeEnd(Long auditTimeEnd) {
        if (null == createTimeStart){
            return;
        }
        LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(auditTimeEnd), ZoneId.systemDefault());
        this.auditTimeEnd = localDateTime;
    }
}
